﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="News.ascx.cs" Inherits="UserControl_News" %>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllNews"
    TypeName="News"></asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
    AllowPaging="True" PageSize="5" BorderWidth="0px" BorderColor="#E5ECF9" DataKeyNames="Id"
    GridLines="None" ShowFooter="True" Font-Size="12px">
    <PagerSettings PageButtonCount="1" Visible="False" />
    <Columns>
        <asp:TemplateField SortExpression="Title">
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "../News.aspx?newsId=" + (string)Eval("Id") %>'> 
                                    <%# Eval("Title").ToString().PadRight(15, ' ').Substring(0, 15)%>
                </asp:HyperLink>
                <asp:Image ID="Image1" runat="server" ImageUrl="~/images/new.gif" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EditRowStyle BorderColor="#E5ECF9" BorderWidth="0px" />
    <AlternatingRowStyle BorderColor="#E5ECF9" BorderWidth="0px" />
</asp:GridView>
